// pages/personal/balancerecharge/balancerecharge.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        current: 0,
        animationData: {},
        animationData2: {},
        recharge:[
            {

            },{

            },{

            }
        ]
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        var that = this;
        wx.getSystemInfo({
            success(res) {
                that.setData({
                    windowHeight: res.windowHeight * 0.26
                })
            }
        })
        this.stretch(this.data.windowHeight);
        this.shrink(100);
    },
 
    change(e) {
        this.setData({
            current: e.detail.current
        })
        this.stretch(this.data.windowHeight)
        this.shrink(100)
    },
    // 收缩
    stretch(h) {
        var animation = wx.createAnimation({
            duration: 1000,
            timingFunction: 'ease',
        })
        this.animation = animation
        animation.height(h).step()
        this.setData({
            animationData: animation.export(),
        })
    },
    // 展开
    shrink(h) {
        var animation2 = wx.createAnimation({
            duration: 1000,
            timingFunction: 'ease',
        })
        this.animation2 = animation2
        animation2.height(h).step()
        this.setData({
            animationData2: animation2.export()
        })
    },

    //充值成功跳转页面
    formSubmit:function(e){
        wx.navigateTo({
            url: '../chargesuccess/chargesuccess',
        })
    },
    //开通会员页面
    onOpenVipTap: function (e) {
        var that = this;
        that.setData({
            ishidden: true
        })
        wx.navigateTo({
            url: '../../openvip/openvip'
        })
    },
})